%GENERATE TABLE 2;
clear all;  addpath('auxiliar'); addpath('Simulated_Datasets');load SIMULATION_ERGODIC_DE.mat;
 [num,tex] = xlsread('targets.xls','Sheet1');
targets=[mean(num(:,5)), std(num(:,9)), mean(num(:,2)), mean(num(:,3)),std(num(:,6)), std(num(:,7)),mean(num(:,4)),std(num(:,8))];
 matrix={'Discount Factor' , beta,'Avg. total debt' , targets(7), moms(7) ;
         'Vol. taste shock', v,'Vol. total debt',targets(8), moms(8) ;
         'Corr. taste shock',p,'Vol. public debt',targets(6), moms(6) ;
         'Avg. financial shock',meank,'Avg. private debt' , targets(3), moms(3) ;
         'Vol. financial shock',sigmak,'Vol. private debt' , targets(5), moms(5) ;
         'Default cost',kost0,'Avg. spread',targets(1),moms(1);
         'Default cost',kost1,'Vol. spread',targets(2),moms(2)};
  columnLabels = {'Description', 'Parameter','Moment','Target','Model'};
  matrix2latex(matrix, 'Tables\Table_2.tex', 'columnLabels', columnLabels, 'alignment', 'c','format', '%-6.2f');